package top.lilele.adminSystem.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

import javax.validation.constraints.NotEmpty;
import java.io.Serializable;
import java.util.Date;

/**
 * @author lilele
 */
@TableName(value = "admin_notice")
@Data
public class AdminNoticeEntity implements Serializable {
    @TableId(value = "id", type = IdType.ASSIGN_ID)
    private String id;

    @NotEmpty(message = "公告标题不能为空")
    @Length(max = 50, message = "公告标题限制50个字符")
    @TableField(value = "title")
    private String title;


    @NotEmpty(message = "公告内容不能为空")
    @TableField(value = "content")
    private String content;

    @NotEmpty(message = "公告类型不能为空")
    @TableField(value = "type")
    private String type;


    @TableField(value = "createdId")
    private String createdId;

    @TableField(value = "createdTime", fill = FieldFill.INSERT)
    private Date createdTime;
    @TableField(value = "updatedTime", fill = FieldFill.INSERT_UPDATE)
    private Date updatedTime;
}
